<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">


<ui:composition template="/template.xhtml">
	<ui:define name="tituloPagina">
		<p:outputLabel value="#{msgs['paginas.validar.compromissos']}" />
	</ui:define>
	<ui:define name="principal">
		<style type="text/css">
.ui-datatable.ui-widget,.ui-datatable.ui-widget .ui-datatable-tablewrapper,.ui-datatable.ui-widget .ui-datatable-tablewrapper table
	{
	font-size: 15px;
}
</style>

		<p:dialog id="basicDialogValidar" style="width: 2000px;"
			widgetVar="dialogValidar" resizable="false">
			<h4>Deseja Validar?</h4>
			<p:commandButton value="Sim"
				action="#{compromissoBean.validarCompromisso}" ajax="false"
				style="width: 81px; margin-top: 25px;"></p:commandButton>
			<p:commandButton value="Não" onclick="PF('dialogValidar').hide();"
				style="width: 81px; margin-left: 20px;"></p:commandButton>

		</p:dialog>

		<p:panelGrid columns="2">
			<p:selectOneMenu value="#{compromissoBean.idReuniaoSelecionada}"
				style="width: 350px;">

				<f:selectItem itemLabel="selecione a Reuniao" itemValue=""></f:selectItem>
				<f:selectItems value="#{compromissoBean.listaReunioes}">
				</f:selectItems>
			</p:selectOneMenu>

			<p:commandButton
				action="#{compromissoBean.consultarCompromissoNaoValidados()}"
				icon="ui-icon-search" ajax="false"></p:commandButton>
		</p:panelGrid>
		<br></br>
		<br></br>
		
		
	






		<p:dataTable value="#{compromissoBean.listaCompromissoNaoValidado}"
			var="_lista" id="data">
			
			<p:column headerText="">
			
			<f:facet name="header">
			<p:selectBooleanCheckbox value="#{compromissoBean.marcarDesmarcarTodos}" style="margin-left: -47px;" rendered="#{compromissoBean.listaCompromissoNaoValidado.size() >0}">
			            <p:ajax update="data" listener="#{compromissoBean.marcarDesmarcarTodosCompromissos()}" />
			
			</p:selectBooleanCheckbox>
			

			</f:facet>
				<p:selectBooleanCheckbox value="#{_lista.validacao}"></p:selectBooleanCheckbox>

			</p:column>

			<p:column headerText="Data da Reunião">
				<p:outputLabel value="#{_lista.reuniao.dataReuniao}">
					<f:convertDateTime pattern="dd/MM/yyyy hh:mm" timeZone="GMT-03:00" />
				</p:outputLabel>
			</p:column>

			<p:column headerText="Meta">
				<p:outputLabel value="#{_lista.metaConclusao}">
					<f:convertDateTime pattern="dd/MM/yyyy" timeZone="GMT-03:00" />

				</p:outputLabel>
			</p:column>

			<p:column headerText="Número">
				<p:outputLabel value="#{_lista.numeroCompromisso}" />
			</p:column>


			<p:column headerText="Status">
				<p:outputLabel value="#{_lista.status}" />
			</p:column>

			<p:column headerText="Projeto">
				<p:outputLabel value="#{_lista.projeto.nome}" />
			</p:column>

			<p:column headerText="Responsável">
				<p:outputLabel value="#{_lista.pessoa.nome}" />
			</p:column>

			


			<p:column headerText="Descrição">
				<p:outputLabel value="#{_lista.descricao}" />
			</p:column>

			<p:column headerText="Ações" style="width: 120px;">
				<p:commandButton action="#{compromissoBean.editarValidacao()}"
					ajax="false" icon="ui-icon-pencil" style="width: 20px;">

					<f:setPropertyActionListener
						target="#{compromissoBean.compromisso}" value="#{_lista}" />
				</p:commandButton>

				<p:commandButton icon="ui-icon-trash" onclick="PF('dialog').show();"
					ajax="true" style="width: 20px;">
					<f:setPropertyActionListener
						target="#{compromissoBean.compromisso}" value="#{_lista}" />
				</p:commandButton>

				<p:dialog id="basicDialogExcluir" style="width: 2000px;"
					widgetVar="dialog" resizable="false">
					<h4>Deseja Excluir?</h4>
					<p:commandButton value="Sim" action="#{compromissoBean.excluir}"
						ajax="false" style="width: 81px; margin-top: 25px;"></p:commandButton>
					<p:commandButton value="Não"
						onclick="PF('basicDialogExcluir').hide();"
						style="width: 81px; margin-left: 20px;"></p:commandButton>

				</p:dialog>
			</p:column>
		</p:dataTable>
	</ui:define>
	<ui:define name="botoes">
		<p:commandButton onclick="PF('dialogValidar').show();" ajax="true"
			icon="ui-icon-circle-check" value="Validar Compromissos Selecionados"
			rendered="#{compromissoBean.listaCompromissoNaoValidado.size() > 0}" />
	</ui:define>
</ui:composition>
</html>